.class public Lweibo4android/SavedSearch;
.super Lweibo4android/WeiboResponse;
.source "SavedSearch.java"


# static fields
.field private static final serialVersionUID:J = 0x2acbedd301ef9884L


# instance fields
.field private createdAt:Ljava/util/Date;

.field private id:I

.field private name:Ljava/lang/String;

.field private position:I

.field private query:Ljava/lang/String;


# direct methods
.method constructor <init>(Lweibo4android/http/Response;)V
    .locals 1
    .parameter "res"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lweibo4android/WeiboException;
        }
    .end annotation

    .prologue
    .line 53
    invoke-direct {p0, p1}, Lweibo4android/WeiboResponse;-><init>(Lweibo4android/http/Response;)V

    .line 54
    invoke-virtual {p1}, Lweibo4android/http/Response;->asJSONObject()Lweibo4android/org/json/JSONObject;

    move-result-object v0

    invoke-direct {p0, v0}, Lweibo4android/SavedSearch;->init(Lweibo4android/org/json/JSONObject;)V

    .line 55
    return-void
.end method

.method constructor <init>(Lweibo4android/http/Response;Lweibo4android/org/json/JSONObject;)V
    .locals 0
    .parameter "res"
    .parameter "json"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lweibo4android/WeiboException;
        }
    .end annotation

    .prologue
    .line 58
    invoke-direct {p0, p1}, Lweibo4android/WeiboResponse;-><init>(Lweibo4android/http/Response;)V

    .line 59
    invoke-direct {p0, p2}, Lweibo4android/SavedSearch;->init(Lweibo4android/org/json/JSONObject;)V

    .line 60
    return-void
.end method

.method constructor <init>(Lweibo4android/org/json/JSONObject;)V
    .locals 0
    .parameter "savedSearch"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lweibo4android/WeiboException;
        }
    .end annotation

    .prologue
    .line 62
    invoke-direct {p0}, Lweibo4android/WeiboResponse;-><init>()V

    .line 63
    invoke-direct {p0, p1}, Lweibo4android/SavedSearch;->init(Lweibo4android/org/json/JSONObject;)V

    .line 64
    return-void
.end method

.method static constructSavedSearches(Lweibo4android/http/Response;)Ljava/util/List;
    .locals 7
    .parameter "res"
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Lweibo4android/http/Response;",
            ")",
            "Ljava/util/List",
            "<",
            "Lweibo4android/SavedSearch;",
            ">;"
        }
    .end annotation

    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lweibo4android/WeiboException;
        }
    .end annotation

    .prologue
    .line 67
    invoke-virtual {p0}, Lweibo4android/http/Response;->asJSONArray()Lweibo4android/org/json/JSONArray;

    move-result-object v1

    .line 70
    .local v1, json:Lweibo4android/org/json/JSONArray;
    :try_start_0
    new-instance v3, Ljava/util/ArrayList;

    invoke-virtual {v1}, Lweibo4android/org/json/JSONArray;->length()I

    move-result v4

    invoke-direct {v3, v4}, Ljava/util/ArrayList;-><init>(I)V

    .line 71
    .local v3, savedSearches:Ljava/util/List;,"Ljava/util/List<Lweibo4android/SavedSearch;>;"
    const/4 v0, 0x0

    .local v0, i:I
    :goto_0
    invoke-virtual {v1}, Lweibo4android/org/json/JSONArray;->length()I

    move-result v4

    if-lt v0, v4, :cond_0

    .line 74
    return-object v3

    .line 72
    :cond_0
    new-instance v4, Lweibo4android/SavedSearch;

    invoke-virtual {v1, v0}, Lweibo4android/org/json/JSONArray;->getJSONObject(I)Lweibo4android/org/json/JSONObject;

    move-result-object v5

    invoke-direct {v4, p0, v5}, Lweibo4android/SavedSearch;-><init>(Lweibo4android/http/Response;Lweibo4android/org/json/JSONObject;)V

    invoke-interface {v3, v4}, Ljava/util/List;->add(Ljava/lang/Object;)Z
    :try_end_0
    .catch Lweibo4android/org/json/JSONException; {:try_start_0 .. :try_end_0} :catch_0

    .line 71
    add-int/lit8 v0, v0, 0x1

    goto :goto_0

    .line 75
    .end local v0           #i:I
    .end local v3           #savedSearches:Ljava/util/List;,"Ljava/util/List<Lweibo4android/SavedSearch;>;"
    :catch_0
    move-exception v2

    .line 76
    .local v2, jsone:Lweibo4android/org/json/JSONException;
    new-instance v4, Lweibo4android/WeiboException;

    new-instance v5, Ljava/lang/StringBuilder;

    invoke-virtual {v2}, Lweibo4android/org/json/JSONException;->getMessage()Ljava/lang/String;

    move-result-object v6

    invoke-static {v6}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v6

    invoke-direct {v5, v6}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v6, ":"

    invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v5

    invoke-virtual {p0}, Lweibo4android/http/Response;->asString()Ljava/lang/String;

    move-result-object v6

    invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v5

    invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v5

    invoke-direct {v4, v5, v2}, Lweibo4android/WeiboException;-><init>(Ljava/lang/String;Ljava/lang/Exception;)V

    throw v4
.end method

.method private init(Lweibo4android/org/json/JSONObject;)V
    .locals 4
    .parameter "savedSearch"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lweibo4android/WeiboException;
        }
    .end annotation

    .prologue
    .line 82
    :try_start_0
    const-string v1, "created_at"

    invoke-virtual {p1, v1}, Lweibo4android/org/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    const-string v2, "EEE MMM dd HH:mm:ss z yyyy"

    invoke-static {v1, v2}, Lweibo4android/SavedSearch;->parseDate(Ljava/lang/String;Ljava/lang/String;)Ljava/util/Date;

    move-result-object v1

    iput-object v1, p0, Lweibo4android/SavedSearch;->createdAt:Ljava/util/Date;

    .line 83
    const-string v1, "query"

    const/4 v2, 0x1

    invoke-static {v1, p1, v2}, Lweibo4android/SavedSearch;->getString(Ljava/lang/String;Lweibo4android/org/json/JSONObject;Z)Ljava/lang/String;

    move-result-object v1

    iput-object v1, p0, Lweibo4android/SavedSearch;->query:Ljava/lang/String;

    .line 84
    const-string v1, "position"

    invoke-static {v1, p1}, Lweibo4android/SavedSearch;->getInt(Ljava/lang/String;Lweibo4android/org/json/JSONObject;)I

    move-result v1

    iput v1, p0, Lweibo4android/SavedSearch;->position:I

    .line 85
    const-string v1, "name"

    const/4 v2, 0x1

    invoke-static {v1, p1, v2}, Lweibo4android/SavedSearch;->getString(Ljava/lang/String;Lweibo4android/org/json/JSONObject;Z)Ljava/lang/String;

    move-result-object v1

    iput-object v1, p0, Lweibo4android/SavedSearch;->name:Ljava/lang/String;

    .line 86
    const-string v1, "id"

    invoke-static {v1, p1}, Lweibo4android/SavedSearch;->getInt(Ljava/lang/String;Lweibo4android/org/json/JSONObject;)I

    move-result v1

    iput v1, p0, Lweibo4android/SavedSearch;->id:I
    :try_end_0
    .catch Lweibo4android/org/json/JSONException; {:try_start_0 .. :try_end_0} :catch_0

    .line 90
    return-void

    .line 87
    :catch_0
    move-exception v0

    .line 88
    .local v0, jsone:Lweibo4android/org/json/JSONException;
    new-instance v1, Lweibo4android/WeiboException;

    new-instance v2, Ljava/lang/StringBuilder;

    invoke-virtual {v0}, Lweibo4android/org/json/JSONException;->getMessage()Ljava/lang/String;

    move-result-object v3

    invoke-static {v3}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v3

    invoke-direct {v2, v3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v3, ":"

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {p1}, Lweibo4android/org/json/JSONObject;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-direct {v1, v2, v0}, Lweibo4android/WeiboException;-><init>(Ljava/lang/String;Ljava/lang/Exception;)V

    throw v1
.end method


# virtual methods
.method public equals(Ljava/lang/Object;)Z
    .locals 5
    .parameter "o"

    .prologue
    const/4 v1, 0x1

    const/4 v2, 0x0

    .line 114
    if-ne p0, p1, :cond_1

    .line 125
    :cond_0
    :goto_0
    return v1

    .line 115
    :cond_1
    instance-of v3, p1, Lweibo4android/SavedSearch;

    if-nez v3, :cond_2

    move v1, v2

    goto :goto_0

    :cond_2
    move-object v0, p1

    .line 117
    check-cast v0, Lweibo4android/SavedSearch;

    .line 119
    .local v0, that:Lweibo4android/SavedSearch;
    iget v3, p0, Lweibo4android/SavedSearch;->id:I

    iget v4, v0, Lweibo4android/SavedSearch;->id:I

    if-eq v3, v4, :cond_3

    move v1, v2

    goto :goto_0

    .line 120
    :cond_3
    iget v3, p0, Lweibo4android/SavedSearch;->position:I

    iget v4, v0, Lweibo4android/SavedSearch;->position:I

    if-eq v3, v4, :cond_4

    move v1, v2

    goto :goto_0

    .line 121
    :cond_4
    iget-object v3, p0, Lweibo4android/SavedSearch;->createdAt:Ljava/util/Date;

    iget-object v4, v0, Lweibo4android/SavedSearch;->createdAt:Ljava/util/Date;

    invoke-virtual {v3, v4}, Ljava/util/Date;->equals(Ljava/lang/Object;)Z

    move-result v3

    if-nez v3, :cond_5

    move v1, v2

    goto :goto_0

    .line 122
    :cond_5
    iget-object v3, p0, Lweibo4android/SavedSearch;->name:Ljava/lang/String;

    iget-object v4, v0, Lweibo4android/SavedSearch;->name:Ljava/lang/String;

    invoke-virtual {v3, v4}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v3

    if-nez v3, :cond_6

    move v1, v2

    goto :goto_0

    .line 123
    :cond_6
    iget-object v3, p0, Lweibo4android/SavedSearch;->query:Ljava/lang/String;

    iget-object v4, v0, Lweibo4android/SavedSearch;->query:Ljava/lang/String;

    invoke-virtual {v3, v4}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v3

    if-nez v3, :cond_0

    move v1, v2

    goto :goto_0
.end method

.method public getCreatedAt()Ljava/util/Date;
    .locals 1

    .prologue
    .line 93
    iget-object v0, p0, Lweibo4android/SavedSearch;->createdAt:Ljava/util/Date;

    return-object v0
.end method

.method public getId()I
    .locals 1

    .prologue
    .line 109
    iget v0, p0, Lweibo4android/SavedSearch;->id:I

    return v0
.end method

.method public getName()Ljava/lang/String;
    .locals 1

    .prologue
    .line 105
    iget-object v0, p0, Lweibo4android/SavedSearch;->name:Ljava/lang/String;

    return-object v0
.end method

.method public getPosition()I
    .locals 1

    .prologue
    .line 101
    iget v0, p0, Lweibo4android/SavedSearch;->position:I

    return v0
.end method

.method public getQuery()Ljava/lang/String;
    .locals 1

    .prologue
    .line 97
    iget-object v0, p0, Lweibo4android/SavedSearch;->query:Ljava/lang/String;

    return-object v0
.end method

.method public hashCode()I
    .locals 3

    .prologue
    .line 130
    iget-object v1, p0, Lweibo4android/SavedSearch;->createdAt:Ljava/util/Date;

    invoke-virtual {v1}, Ljava/util/Date;->hashCode()I

    move-result v0

    .line 131
    .local v0, result:I
    mul-int/lit8 v1, v0, 0x1f

    iget-object v2, p0, Lweibo4android/SavedSearch;->query:Ljava/lang/String;

    invoke-virtual {v2}, Ljava/lang/String;->hashCode()I

    move-result v2

    add-int v0, v1, v2

    .line 132
    mul-int/lit8 v1, v0, 0x1f

    iget v2, p0, Lweibo4android/SavedSearch;->position:I

    add-int v0, v1, v2

    .line 133
    mul-int/lit8 v1, v0, 0x1f

    iget-object v2, p0, Lweibo4android/SavedSearch;->name:Ljava/lang/String;

    invoke-virtual {v2}, Ljava/lang/String;->hashCode()I

    move-result v2

    add-int v0, v1, v2

    .line 134
    mul-int/lit8 v1, v0, 0x1f

    iget v2, p0, Lweibo4android/SavedSearch;->id:I

    add-int v0, v1, v2

    .line 135
    return v0
.end method

.method public toString()Ljava/lang/String;
    .locals 3

    .prologue
    const/16 v2, 0x27

    .line 140
    new-instance v0, Ljava/lang/StringBuilder;

    const-string v1, "SavedSearch{createdAt="

    invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    .line 141
    iget-object v1, p0, Lweibo4android/SavedSearch;->createdAt:Ljava/util/Date;

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v0

    .line 142
    const-string v1, ", query=\'"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    iget-object v1, p0, Lweibo4android/SavedSearch;->query:Ljava/lang/String;

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;

    move-result-object v0

    .line 143
    const-string v1, ", position="

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    iget v1, p0, Lweibo4android/SavedSearch;->position:I

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v0

    .line 144
    const-string v1, ", name=\'"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    iget-object v1, p0, Lweibo4android/SavedSearch;->name:Ljava/lang/String;

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;

    move-result-object v0

    .line 145
    const-string v1, ", id="

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    iget v1, p0, Lweibo4android/SavedSearch;->id:I

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v0

    .line 146
    const/16 v1, 0x7d

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;

    move-result-object v0

    .line 140
    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method
